var banners = ['./images/banner.jpg', './images/banner1.jpg', './images/banner2.jpg'];
    var currentIndex = 0;
    var bannerImg = document.getElementById('baseImg');

    function autoPlay() {
        currentIndex++;
        if (currentIndex >= banners.length) {
            currentIndex = 0;
        }
        bannerImg.src = banners[currentIndex];
    }

    bannerImg.addEventListener('mouseover', function() {
        clearInterval(intervalId);
    });

    bannerImg.addEventListener('mouseout', function() {
        intervalId = setInterval(autoPlay, 3000);
    });

    var intervalId = setInterval(autoPlay, 3000);